import React, { Component } from "react";
import { Flex, Card, WhiteSpace, WingBlank } from "antd-mobile";
import "./mine.less";
import axios from 'axios'

class Mine extends Component {
  constructor(props) {
    super(props);
    this.handleClick = this.handleClick.bind(this);
  }
  componentDidMount(){
    axios.get('/api/user/info').then(res=>{
      console.log(res.data)
    })
  }
  handleClick() {
    this.props.history.push('/login')
  }
  render() {
    return (
      <div>
        <WingBlank>
          <WhiteSpace />
          <Card>
            <Card.Header
              title="点击登录"
              thumb={require("../../assets/imgs/avatar.png")}
              thumbStyle={{ width: 100 }}
              onClick={this.handleClick}
            />
            <Card.Body>
              <Flex>
                <Flex.Item>
                  <dl>
                    <dt>
                      <img
                        src={require("../../assets/imgs/like-empty.png")}
                        alt=""
                      />
                    </dt>
                    <dd onClick={()=>this.props.history.push('/myCollect')}>收藏</dd>
                  </dl>
                </Flex.Item>
                <Flex.Item>
                  <dl>
                    <dt>
                      <img
                        src={require("../../assets/imgs/history-empty.png")}
                        alt=""
                      />
                    </dt>
                    <dd onClick={()=>this.props.history.push('/myHistory')}>历史</dd>
                  </dl>
                </Flex.Item>
              </Flex>
            </Card.Body>
          </Card>
        </WingBlank>
      </div>
    );
  }
}

export default Mine;
